<template>
  <div class="container">
    <el-dialog
      title="高退低进操作详情"
      :visible.sync="dialog.centerDialogVisible"
      @open="getData"
      @close="confirm"
      center
      width="800px"
    >
      <div class="top">
        <!-- <div class="toptitle">操作商品</div> -->
        <div class="toptitle">商品名称：{{ datainfo.goods_name }}</div>
        <div class="toptitle">商品总金额：{{ datainfo.amount }}</div>
      </div>
      <div class="title">原批次数据</div>
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="code"
          label="批次编号"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="price"
          label="原价格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="num"
          label="原数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="dcname"
          label="配送中心名字"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="whsename"
          label=" 仓库名字"
          align="center"
        ></el-table-column>
      </el-table>
      <div class="title">出库数据</div>

      <el-table
        :data="tableData1"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="code"
          label="批次编号"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="price"
          label="出库价格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="num"
          label="出库数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="dcname"
          label="配送中心名字"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="whsename"
          label=" 仓库名字"
          align="center"
        ></el-table-column>
      </el-table>

      <div class="title">入库数据</div>

      <el-table
        :data="tableData2"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="code"
          label="批次编号"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="price"
          label="入库价格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="num"
          label="入库数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="dcname"
          label="配送中心名字"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="whsename"
          label=" 仓库名字"
          align="center"
        ></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { Changepriceindexshow } from "@/api/stockHeight/stockhei"; //商品
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: [],
      tableData1: [],
      tableData2: [],
      datainfo: {
        goods_name: "",
        amount: ""
      }
    };
  },
  created() {},
  methods: {
    //关闭
    confirm() {
      this.dialog.centerDialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = [];
      this.center = [];
      let data = {
        id: this.dialog.id
      };
      Changepriceindexshow(data).then(res => {
        if (res.code == 0) {
          this.datainfo.goods_name = res.data.holi_info.goods_name;
          this.datainfo.amount = res.data.holi_info.amount;
          this.tableData = res.data.holi_detail_info.source_inp_details_info;
          this.tableData1 = res.data.holi_detail_info.out_details_info;
          this.tableData2 = res.data.holi_detail_info.inp_details_info;
        }
      });
    }
  }
};
</script>
<style scoped>
.top {
  text-align: center;
  margin: 0 auto;
  padding: 0;
  clear: both;
}
.toptitle {
  margin: 0;
  padding: 30px;
  display: inline-block;
  _display: inline;
  *display: inline;
  zoom: 1;
  line-height: 40px;
  font-size: 16px;
  font-weight: bold;
}

.pagination {
  text-align: right;
  padding: 10px;
  background-size: cover;
}
.title {
  text-align: center;
  line-height: 40px;
  font-size: 16px;
  font-weight: bold;
}
</style>
